Master PowerShell tricks (Volume 1) by Dave Kawula & Thomas Rayner & Sean Kearney & Allan Rafuse & Ed Wilson
Author:Dave Kawula & Thomas Rayner & Sean Kearney & Allan Rafuse & Ed Wilson [Kawula, Dave]
Language: eng
Format: epub
Published: 2016-12-17T23:00:00+00:00
Things to thing about
After running this script you’ll hopefully find and fix everything. Perhaps you may want to thinking about creating a script, run it as a scheduled task and centralize the results for further auditing.
The Code
$FromDate = (Get-Date).AddDays(-30)
$Content = Get-Content "\\$DomainController\c$\Windows\Debug\netlogon.log"
# Run through the netlogon.log (in reverse order, think about speed/performance) while the dates are greater than $FromDate
$MissingEntry = @{}
For ($counter = $Content.Count; $counter -ge 0; $counter--) {
If ($Content[$counter] -match "(\d\d)/(\d\d) (\d\d):(\d\d):(\d\d)") {
$EntryDate = Get-Date -Month $matches[1] -Day $matches[2] -Hour $Matches[3] -Minute $Matches[4] -Second $Matches[5]
if ($EntryDate -lt $FromDate) {
break
}
# Within the timeframe, let's save the IP and Date attempted in a hashtable. Only keep the first hit, which is the latest failed site attempt
$ip = $Content[$counter] -Replace ".* (.*)$", '$1'
If ($MissingEntry[$ip] -eq $null) {
$MissingEntry[$ip]= $EntryDate
}
}
}
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7766)
Filmora Efficient Editing by Alexander Zacharias(5790)
The Infinite Retina by Robert Scoble Irena Cronin(5270)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3981)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3935)
Edit Like a Pro with iMovie by Regit(3431)
Linux Administration Best Practices by Scott Alan Miller(2858)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2836)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2521)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2405)
Docker on Windows by Stoneman Elton(2319)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2315)
Creative Projects for Rust Programmers by Carlo Milanesi(2254)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2109)
Hands-On Linux for Architects by Denis Salamanca(2052)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2005)
Computers For Seniors For Dummies by Nancy C. Muir(2001)
The Old New Thing by Raymond Chen(1941)
Linux Kernel Debugging by Kaiwan N Billimoria(1762)
